#ifndef FUEL_REFUND_H
#define FUEL_REFUND_H

#include "fuel_refund_struct_csv.hpp"
#include "file_list.hpp"

#include "boost/date_time/posix_time/posix_time.hpp"
#include <iostream>

using namespace boost::posix_time;
using namespace boost::gregorian;


class fuel_refund
{
  public:
	inline virtual ~fuel_refund() { };

	//static bool exist(int _id);
	
	//static bool exist(int _id_range_ownership, int _id_fuel);

	//static float find_fuel_refund_unit(int _fuel_refund_id, date& _date);

	//static float find_fuel_refund_unit(int _power_range_ownership_id, int _fuel_id, date& _travelling_date);
  private:
};



// implementation for csv files

class fuel_refund_csv: public fuel_refund
{
  public:
	inline fuel_refund_csv(char* filename): file(filename)
	{ }

	inline fuel_refund_csv(std::string filename): file(filename)
	{ }

	inline fuel_refund_csv(): file(file_list::fuel_refund_filename())
	{ }

	//static bool exist(int _id);

	//static bool exist(int _id_range_ownership, int _id_fuel);
	
	static float find_fuel_refund_unit(int _fuel_refund_id, date& _travelling_date);
	
	static float find_fuel_refund_unit(int _power_range_ownership_id, int _fuel_id, date& _travelling_date);	


  protected:

	static fuel_refund_struct_csv const find(int _id, date& _date);	

	static fuel_refund_struct_csv const find(int _id_range_ownership, int _id_fuel, date _date);
	
  private:
	std::string file;
};

#endif
